﻿using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Collections.Generic;
using MS.InformationManagement.Presenter.ChildRadicados;

namespace MS.InformationManagement.Controls._CONTROLTEMPLATES.InformationManagerControls
{
    public partial class ChildRadicadosItems : UserControl, IChildRadicadosView
    {

        #region fields

        ChildRadicadosPresenter _presenter;

        #endregion

        #region Properties

        public string CurrentList { get { return !string.IsNullOrEmpty(Page.Request.QueryString["List"]) ? Page.Request.QueryString["List"] : Page.Request.QueryString["ListId"]; } }

        public IEnumerable<DAL.DocumentCenter.Radicado> ChildsEntity { get; set; }

        public List<string> Childs { get; set; }

        #endregion

        #region Methods

        protected void Page_Load(object sender, EventArgs e)
        {
            _presenter = new ChildRadicadosPresenter(this);
            if (!IsPostBack && Childs != null)
                _presenter.HandleLoad();
        }

        #endregion

        #region Implemented Methods

        public void Show()
        {
            gvChilds.DataSource = ChildsEntity;
            gvChilds.DataBind();
        }

        #endregion

    }
}
